//
//  NewsViewController.swift
//  SwiftNews
//
//  Created by admin on 15/10/22.
//  Copyright © 2015年 admin. All rights reserved.
//

import UIKit

class NewsViewController: PersonViewController {

    
    //获取屏幕的宽和高
    let MainScreenWidth = UIScreen.mainScreen().bounds.size.width
    let MainScreenHeight = UIScreen.mainScreen().bounds.size.height
    
    var myNavigationView:NavigationView!
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        [self .addView()];
        // Do any additional setup after loading the view.
    }

    func addView(){
    
        
        myNavigationView = NavigationView (frame: CGRectMake(0, 0, MainScreenWidth, 20+(self.navigationController?.navigationBar.frame.size.height)!));
        
        myNavigationView.returnLeftButtonClicked = {
           
            
        }
        
        myNavigationView.returnRightButtonClicked = {
        
        
        }
        
        myNavigationView.setTextLabelView(200, labelText: "财经头条")
        
        self.view.addSubview(myNavigationView);
        
        

        
        
        let  newsTableView = NewsTableView (frame: CGRectMake(0, myNavigationView.frame.size.height, MainScreenWidth, MainScreenHeight-myNavigationView.frame.size.height-(self.navigationController?.navigationBar.frame.size.height)!), style: UITableViewStyle.Plain)
        
        
        
        
        self.view .addSubview(newsTableView);
        
        
    
    }
    
    
   
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
